package com.web.mapper;

import com.web.com.web.entity.Student;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentMapper {

    @Select("select * from student")
    public List<Student> list();

    @Select("select * from student where id=#{id}")
    public Student get(Integer id);

    @Insert("insert into student(name,age,sex,address,phone,email) values(#{name},#{age},#{sex},#{address},#{phone},#{email})")
    public void insert(Student student);

    @Update("update student set name=#{name},age=#{age},sex=#{sex},address=#{address},phone=#{phone},email=#{email} where id=#{id}")
    public void update(Student student);

    @Delete("delete from student where id=#{id}")
    public void delete(Integer id);

}
